package config

import (
	"errors"
	"fmt"
	"github.com/BurntSushi/toml"
	"path/filepath"
)

type SYSConfig struct {
	Environment string `toml:"environment" json:"environment"`
}

var SysConfig *SYSConfig

func InitSysConfig() {
	//读取配置文件部分
	filePath, err := filepath.Abs("./config/sys_config.toml")
	if err != nil {
		panic(err)
	}
	if _, err := toml.DecodeFile(filePath, &SysConfig); err != nil {
		fmt.Println(err.Error())
		panic(errors.New("system配置文件读取失败"))
	}
}
